package com.skwen.ssm.serviceImp;

import com.skwen.ssm.dao.UserDao;
import com.skwen.ssm.po.User;
import com.skwen.ssm.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("UserService")
public class UserServiceImpl implements UserService {

    @Resource(name = "UserDao")
    private UserDao userDao;

    public List<User> getListUser() {
        return userDao.getListUser();
    }

    public int ifUserRegister(String userPhone) {
        if (userDao.ifUserRegister(userPhone) == null){
            return 0;
        }
        return userDao.ifUserRegister(userPhone);
    }

    public User login(String userAccount, String userPsd) {
        return userDao.login(userAccount,userPsd);
    }

    public void register(User user) {
        userDao.register(user);
    }
}
